package hw04.grammar;

public abstract class Terminal {

	private String match;
	
	/**
	 * Force subclasses to use the String constructor
	 */
	@SuppressWarnings("unused")
	private Terminal() {}
	
	public Terminal(String match) {
		this.match = match;
	}
	
	public String getMatch() {
		return match;
	}
	
	@Override
	public String toString() {
		return getClass().getSimpleName() + ":" + getMatch();
	}

	@Override
	public boolean equals(Object o) {
		return o.getClass().equals(getClass()) && getMatch().equals(getMatch());
	}
}
